package practice07;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice07
 * @ClassName: Truck
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/8 15:31
 * @Copyright 大牛版板所有
 */
public class Truck extends Car {
    private double payload;

    public Truck() {
    }

    public Truck(int wheels, double weight, int loader, double payload) {
        super(wheels, weight, loader);
        this.payload = payload;
    }

    public double getPayload() {
        return payload;
    }

    public void setPayload(double payload) {
        this.payload = payload;
    }

    @Override
    public void print(){
        System.out.println("卡车有"+this.getWheels()+"轮子，车重是"+this.getWeight()+"吨，可以载"+this.getLoader()
        +"，人，载重量是"+this.getPayload()+"千斤");
    }
}
